Skip to content

x-pack/filebeat/input/awss3: aggregate SQS health status reporting#51819

Open
efd6 wants to merge 2 commits into
elastic:mainfrom
efd6:51692-awss3_health
Open

x-pack/filebeat/input/awss3: aggregate SQS health status reporting#51819
efd6 wants to merge 2 commits into
elastic:mainfrom
efd6:51692-awss3_health

Conversation

@efd6

@efd6 efd6 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Proposed commit message

x-pack/filebeat/input/awss3: aggregate SQS health status reporting

Replace scattered per-event UpdateStatus calls in the SQS mode with a
centralized sqsHealth aggregator. The input now stays Running while making
forward progress despite bounded retryable failures, reports Degraded only
for sustained conditions needing operator action, filters out
context.Canceled from shutdown/reload, and clears Degraded only when the
specific causing condition resolves, not when an unrelated poll succeeds.

Key changes:
- New sqsHealth type (active-condition model with Set*/Clear* + recompute)
- Receive errors require 3 consecutive failures before degrading
- Transient S3 processing errors no longer degrade (message retries via
  visibility timeout are by design)
- Keepalive receipt-handle failures no longer degrade (message will retry)
- Successful message delete+finalize clears disposition conditions
- context.Canceled/DeadlineExceeded suppressed at all condition setters
- Subsumes StatusReporterHelper dedup with stricter (enum+msg) check

This commit covers the legacy SQS path only; v2 path follows separately.

Assisted-By: Cursor

Note

This is PR one of two. This can be backported to branches listed if that path is chosen. I think it should be, but this is open to discussion. The second PR wires the v2 path with the same behaviour and cannot be backported to branches prior to 9.5.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works. Where relevant, I have used the stresstest.sh script to run them under stress conditions and race detector to verify their stability.
  • I have added an entry in ./changelog/fragments using the changelog tool.

Disruptive User Impact

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

Replace scattered per-event UpdateStatus calls in the SQS mode with a
centralized sqsHealth aggregator. The input now stays Running while making
forward progress despite bounded retryable failures, reports Degraded only
for sustained conditions needing operator action, filters out
context.Canceled from shutdown/reload, and clears Degraded only when the
specific causing condition resolves, not when an unrelated poll succeeds.

Key changes:
- New sqsHealth type (active-condition model with Set*/Clear* + recompute)
- Receive errors require 3 consecutive failures before degrading
- Transient S3 processing errors no longer degrade (message retries via
  visibility timeout are by design)
- Keepalive receipt-handle failures no longer degrade (message will retry)
- Successful message delete+finalize clears disposition conditions
- context.Canceled/DeadlineExceeded suppressed at all condition setters
- Subsumes StatusReporterHelper dedup with stricter (enum+msg) check

This commit covers the legacy SQS path only; v2 path follows separately.

Assisted-By: Cursor
@efd6 efd6 self-assigned this Jul 8, 2026
@efd6 efd6 added enhancement Team:obs-ds-hosted-services Label for the Observability Hosted Services team bugfix Team:Security-Service Integrations Security Service Integrations Team backport-8.19 Automated backport to the 8.19 branch backport-9.3 Automated backport to the 9.3 branch backport-9.4 backport-9.5 labels Jul 8, 2026
@botelastic botelastic Bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)
  • /test : Run the Buildkite pipeline.

@efd6 efd6 marked this pull request as ready for review July 9, 2026 01:30
@efd6 efd6 requested a review from a team as a code owner July 9, 2026 01:30
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

Pinging @elastic/obs-ds-hosted-services (Team:obs-ds-hosted-services)

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

Pinging @elastic/security-service-integrations (Team:Security-Service Integrations)

Comment thread x-pack/filebeat/input/awss3/health.go Outdated
Comment thread x-pack/filebeat/input/awss3/health.go Outdated
defer h.mu.Unlock()
// Processing errors are transient per the design; the message will
// retry via visibility timeout. We do not set a condition for individual
// processing failures; they are logged and counted in metrics.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they are logged and counted in metrics.

Actually I think we are missing a metric for this. We only have sqsMessagesReturnedTotal which is per sqs message rather than per s3 object. We really could use a per-object failure counter.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't added the per-object failure counter. This is probably follow-up work, but I can do it here if you'd like.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A follow-up is fine. There's another counter that I think would be useful too for the visibility timeout extension failures. We log it today but a counter would be nice.

Comment thread x-pack/filebeat/input/awss3/health.go Outdated
Comment thread x-pack/filebeat/input/awss3/health.go
Comment thread x-pack/filebeat/input/awss3/health.go Outdated
@efd6 efd6 requested a review from andrewkroh July 9, 2026 21:48
@jamiehynds

Copy link
Copy Markdown

@ishleenk17 could you or someone from obs-ds-hosted-services please prioritise a review on this? We have a customer affected by the SQS health reporting issue in the CrowdStrike FDR integration and want to get it merged quickly. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-8.19 Automated backport to the 8.19 branch backport-9.3 Automated backport to the 9.3 branch backport-9.4 backport-9.5 bugfix enhancement Team:obs-ds-hosted-services Label for the Observability Hosted Services team Team:Security-Service Integrations Security Service Integrations Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

x-pack/filebeat/input/awss3: aggregate SQS health status reporting for v1 input

3 participants